package com.search_wheel.pojo.entity;



import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

public class User {

    private Integer id;

    private String username;

    private String email;

    private String bio;

    private Integer status;  // 0：禁用，1：正常

    private Integer followerCount;

    private Integer followingCount;

    private Integer articleCount;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginTime;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", email='" + email + '\'' +
                ", bio='" + bio + '\'' +
                ", status=" + status +
                ", followerCount=" + followerCount +
                ", followingCount=" + followingCount +
                ", articleCount=" + articleCount +
                ", createTime=" + createTime +
                ", lastLoginTime=" + lastLoginTime +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getBio() {
        return bio;
    }

    public void setBio(String bio) {
        this.bio = bio;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getFollowerCount() {
        return followerCount;
    }

    public void setFollowerCount(Integer followerCount) {
        this.followerCount = followerCount;
    }

    public Integer getFollowingCount() {
        return followingCount;
    }

    public void setFollowingCount(Integer followingCount) {
        this.followingCount = followingCount;
    }

    public Integer getArticleCount() {
        return articleCount;
    }

    public void setArticleCount(Integer articleCount) {
        this.articleCount = articleCount;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(LocalDateTime lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public User() {
    }

    public User(Integer id, String username, String email, String bio, Integer status, Integer followerCount, Integer followingCount, Integer articleCount, LocalDateTime createTime, LocalDateTime lastLoginTime) {
        this.id = id;
        this.username = username;
        this.email = email;
        this.bio = bio;
        this.status = status;
        this.followerCount = followerCount;
        this.followingCount = followingCount;
        this.articleCount = articleCount;
        this.createTime = createTime;
        this.lastLoginTime = lastLoginTime;
    }
}
